/*  1:   */ package org.jetbrains.jps.model.java.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.util.Consumer;
import org.jetbrains.jps.model.java.*;
import org.jetbrains.jps.model.library.JpsOrderRootType;
import org.jetbrains.jps.model.module.JpsDependencyElement;
import org.jetbrains.jps.model.module.JpsModule;
import org.jetbrains.jps.model.module.JpsModuleDependency;
import org.jetbrains.jps.model.module.JpsModuleSourceRoot;
import org.jetbrains.jps.model.module.impl.JpsDependenciesRootsEnumeratorBase;

import java.util.Iterator;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */
/* 16:   */
/* 17:   */
/* 18:   */ 
/* 19:   */ public class JpsJavaDependenciesRootsEnumeratorImpl
/* 20:   */   extends JpsDependenciesRootsEnumeratorBase<JpsJavaDependenciesEnumeratorImpl>
/* 21:   */   implements JpsJavaDependenciesRootsEnumerator
/* 22:   */ {
/* 23:   */   private boolean a;
/* 24:   */   
/* 25:   */   public JpsJavaDependenciesRootsEnumeratorImpl(JpsJavaDependenciesEnumeratorImpl paramJpsJavaDependenciesEnumeratorImpl, JpsOrderRootType paramJpsOrderRootType)
/* 26:   */   {
/* 27:31 */     super(paramJpsJavaDependenciesEnumeratorImpl, paramJpsOrderRootType);
/* 28:   */   }
/* 29:   */   
/* 30:   */   public JpsJavaDependenciesRootsEnumerator withoutSelfModuleOutput()
/* 31:   */   {
/* 32:36 */     this.a = true;
/* 33:37 */     return this;
/* 34:   */   }
/* 35:   */   
/* 36:   */   protected boolean processModuleRootUrls(JpsModule paramJpsModule, JpsDependencyElement paramJpsDependencyElement, Consumer<String> paramConsumer)
/* 37:   */   {
/* 38:   */     int i;
/* 39:   */     int j;
/* 40:42 */     if ((paramJpsDependencyElement instanceof JpsModuleDependency))
/* 41:   */     {
/* 42:43 */       boolean bool = ((JpsJavaDependenciesEnumeratorImpl)this.myDependenciesEnumerator).isProductionOnTests(paramJpsDependencyElement);
/* 43:44 */       i = !bool ? 1 : 0;
/* 44:45 */       j = ((!((JpsJavaDependenciesEnumeratorImpl)this.myDependenciesEnumerator).isProductionOnly()) && (((JpsJavaDependenciesEnumeratorImpl)this.myDependenciesEnumerator).shouldIncludeTestsFromDependentModulesToTestClasspath())) || (bool) ? 1 : 0;
/* 45:   */     }
/* 46:   */     else
/* 47:   */     {
/* 48:49 */       i = 1;
/* 49:50 */       j = !((JpsJavaDependenciesEnumeratorImpl)this.myDependenciesEnumerator).isProductionOnly() ? 1 : 0;
/* 50:   */     }
/* 51:   */     Object localObject1;
/* 52:   */     Object localObject2;
/* 53:   */     Object localObject3;
/* 54:53 */     if (this.myRootType == JpsOrderRootType.SOURCES)
/* 55:   */     {
/* 56:54 */       for (localObject1 = paramJpsModule.getSourceRoots().iterator(); ((Iterator)localObject1).hasNext();)
/* 57:   */       {
/* 58:54 */         localObject2 = (JpsModuleSourceRoot)((Iterator)localObject1).next();
/* 59:55 */         localObject3 = ((JpsModuleSourceRoot)localObject2).getRootType();
/* 60:56 */         if (((localObject3.equals(JavaSourceRootType.SOURCE)) && (i != 0)) || ((localObject3.equals(JavaSourceRootType.TEST_SOURCE)) && (j != 0))) {
/* 61:57 */           paramConsumer.consume(((JpsModuleSourceRoot)localObject2).getUrl());
/* 62:   */         }
/* 63:   */       }
/* 64:   */     }
/* 65:61 */     else if (this.myRootType == JpsOrderRootType.COMPILED)
/* 66:   */     {
/* 67:62 */       localObject1 = JpsJavaExtensionService.getInstance();
/* 68:63 */       if ((this.a) && (((JpsJavaDependenciesEnumeratorImpl)this.myDependenciesEnumerator).isEnumerationRootModule(paramJpsModule)))
/* 69:   */       {
/* 70:64 */         if ((i != 0) && (j != 0))
/* 71:   */         {
/* 72:65 */           localObject2 = ((JpsJavaExtensionService)localObject1).getOutputUrl(paramJpsModule, false);
/* 73:66 */           if (localObject2 != null) {
/* 74:67 */             paramConsumer.consume(localObject2);
/* 75:   */           }
/* 76:   */         }
/* 77:   */       }
/* 78:   */       else
/* 79:   */       {
/* 80:72 */         localObject2 = ((JpsJavaExtensionService)localObject1).getOutputUrl(paramJpsModule, false);
/* 81:73 */         if (j != 0)
/* 82:   */         {
/* 83:74 */           localObject3 = ((JpsJavaExtensionService)localObject1).getOutputUrl(paramJpsModule, true);
/* 84:75 */           if ((localObject3 != null) && (!((String)localObject3).equals(localObject2))) {
/* 85:76 */             paramConsumer.consume(localObject3);
/* 86:   */           }
/* 87:   */         }
/* 88:79 */         if ((i != 0) && (localObject2 != null)) {
/* 89:80 */           paramConsumer.consume(localObject2);
/* 90:   */         }
/* 91:   */       }
/* 92:   */     }
/* 93:84 */     else if (this.myRootType == JpsAnnotationRootType.INSTANCE)
/* 94:   */     {
/* 95:85 */       localObject1 = JpsJavaExtensionService.getInstance().getModuleExtension(paramJpsModule);
/* 96:86 */       if (localObject1 != null) {
/* 97:87 */         for (localObject2 = ((JpsJavaModuleExtension)localObject1).getAnnotationRoots().getUrls().iterator(); ((Iterator)localObject2).hasNext();)
/* 98:   */         {
/* 99:87 */           localObject3 = (String)((Iterator)localObject2).next();
/* :0:88 */           paramConsumer.consume(localObject3);
/* :1:   */         }
/* :2:   */       }
/* :3:   */     }
/* :4:92 */     return true;
/* :5:   */   }
/* :6:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.java.impl.JpsJavaDependenciesRootsEnumeratorImpl

 * JD-Core Version:    0.7.0.1

 */